package com.wen.controller;

import com.wen.common.R;
import com.wen.pojo.OrderDetails;
import com.wen.pojo.dto.OrderDetailsDto;
import com.wen.service.OrderDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("OrderDetails")
public class orderDetailsController {

    @Autowired
    private OrderDetailsService service;

    @GetMapping("selById/{id}")
    public R selById(@PathVariable String id){

        List<OrderDetailsDto> orderDetails = service.selById(id);

        return R.ok().data("orderDetails",orderDetails);
    }

    @GetMapping("selId/{id}")
    public R selId(@PathVariable String id){

        OrderDetailsDto orderDetails = service.selId(id);

        return R.ok().data("selId",orderDetails);
    }

}
